﻿using System;
using System.Web;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using AnyOffice.Components;
using AnyOffice.DAL;
namespace AnyOffice.general.system.user_priv
{
    public partial class delete : ModulePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.Page.IsPostBack)
            {
                int num = (Request.QueryString["priv_id"] == null) ? 0 : int.Parse(Request.QueryString["priv_id"].ToString());
                UserPrivDao dao = new UserPrivDao();
                if (dao.Delete(base.Conn, num))
                {
                    this.lblMessage.Text = base.ShowPrompt("角色删除成功!", "index.aspx");
                }
                else
                {
                    this.lblMessage.Text = base.ShowPrompt("该角色下存在用户，请首先删除该角色下的用户！");
                }
            }

        }
    }
}
